Display Xdialog Form based on ADO/ODBC Data

Description

Many applications require a view of external data contained in ADO or ODBC compliant databases. The Display Xdialog Form based on ADO/ODBC Data action allows you to quickly build a dialog box that reads and displays data from compliant databases, such as MySQL, Oracle, and Microsoft Access.

Procedure

The Xdialog box needs a variable to capture the value generated by each control.

  1. Create a new Action Script.

  2. Select "Xdialog Windows" in the Category list.

  3. Select "Display Xdialog Form based on ADO/ODBC Data" in the Action list.

  4. Click OK to display the Script Genie.

  5. Select whether the data source is an Access .mdb file or an ADO Connection string.

    images/ADO_ODBC_1.gif
  6. If you selected Access .mdb file in step 1, continue with Access MDB File. Otherwise, continue with ADO Connection String.

Access MDB File

  1. Enter the MDB Filename and click Connect.

  2. Select whether to base the form on a Table or View or a SQL Select Statement.

    images/ADO_ODBC_2.gif
  3. If you selected Table or View in step 2, continue with Table or View. Otherwise, continue with SQL Select Statement.

ADO Connection String

  1. Select Used Saved Connection String or Specify Connection String now.

    images/ADO_ODBC_8.gif
  2. If you clicked Used Saved Connection String in step 1, make a selection from the Connection Name list. Otherwise, continue with Specify Connection String now.

  3. Click Connect.

  4. Continue with SQL Select Statement.

Specify Connection String now

  1. Click Build to display the Data Link Properties dialog box.

    images/ADO_ODBC_11.gif
    See Windows documentation for a full description of the Data Link Properties dialog box. This procedure documented here works for Microsoft Access databases.
  2. Select Use Connection String and click Build... to display the Select Data Source dialog box.

  3. Enter a name for the data source in the DSN Name field and click New... .

  4. Select "Microsoft Access Driver (*.mdb)" in the Create New Data Source dialog and click Next >.

  5. Click Browse... and navigate to the folder that contains the Microsoft Access database.

  6. Select "All Files" in the Save as type field.

  7. Select the Microsoft Access database and click Save.

  8. Click Next >, Finish, and OK. to display the Select Database dialog.

  9. Select the Microsoft Access database and click OK.

  10. Select the resulting DSN file in the Select Data Source dialog box and click OK and OK to display the Data Link Properties dialog box.

  11. Click Test Connection.

  12. If the connection was successful, click OK.

  13. Select whether to base the form on a Table or View or a SQL Select Statement.

    images/ADO_ODBC_2.gif
  14. If you selected Table or View in step 13, continue with Table or View. Otherwise, continue with SQL Select Statement.

Table or View

  1. Click to select a table or view in the Table/View name field.

  2. Optionally, enter a filter expression in the Filter field.

  3. Optionally, enter an order expression in the Order by field.

  4. Continue with More Fields.

SQL Select Statement

  1. Enter your SQL Select statement and click Test Select Statement.

    images/ADO_ODBC_12.gif

More Fields

  1. Check the Form is read-only check box if you are not going to be writing to the table.

  2. If the Form is read-only check box is cleared, click Select to identify the primary key of the table.

  3. Click Next >.

  4. Select the fields you would like to display from the Available Fields list. Use to add and remove Selected Fields.

  5. Optionally, reorder the sequence of fields with .

    images/ADO_ODBC_3.gif
  6. Optionally, select a field in Selected Fields.

    • 1. Optionally, modify its description in the Label field.

    • 2. Optionally, change its Control Type, Width, and Height.

    • 3. Optionally, change the Tab Page.

    • 4. Optionally, click Set All to set all remaining fields to this Tab Page.

  7. Click Next >.

  8. Select the buttons you would like to display from the Available Buttons list. Use ,,, and to add and remove Selected Buttons.

  9. Optionally, reorder the sequence of buttons with ,,, and .

    images/ADO_ODBC_4.gif
  10. Optionally, select a button in Selected Buttons.

    • 1. Optionally, modify its Type. Click Set All to set this type for all remaining buttons. The options are:

      • "Text"

      • "Picture"

    • 2. Optionally, click the button image to select a different image.

    • 3. Optionally, select a different Border style. Click Set All to set this style for all remaining buttons. The options are:

      • "Raised"

      • "Modern"

      • "Fly-over"

      • "None"

    • 4. Optionally, change the default Bubble Help.

  11. Click Next >.

    images/ADO_ODBC_5.gif
  12. Optionally, on the Window tab change the Window title.

  13. Optionally, change the Background color of the form.

  14. Optionally, change the Font and point size of the text on the form.

  15. Optionally, change the Button bar position. The options are:

    • "Bottom"

    • "Top"

    • "Top and Bottom"

    • "None"

  16. Optionally, check Enclose buttons in frame.

  17. Optionally, change the Form type. The options are:

    • "Modal"

    • "Modeless"

    • "MDI Child Window"

  18. If the choice in step 23 is "MDI Child Window":

    • 1. Optionally, select a Toolbar from the drop-down list.

    • 2. Optionally, select a Menu from the drop-down list.

    • 3. Optionally, change the Title bar icon.

      images/ADO_ODBC_6.gif
  19. Display the Layout Options tab.

  20. Optionally, select a different Layout style. The options are:

    • "Form"

    • "Table"

  21. Optionally, check Repeating Form.

  22. If you checked Repeating Form:

    • 1. Enter the number of Rows.

    • 2. Enter the number of Columns.

    • 3. Select the Snaking option.

      • "Top to Bottom, Left to Right"

      • "Left to Right, Top to Bottom"

  23. Display the Other tab.

  24. Optionally, change the name of the Data Object.

  25. Click Next >.

  26. Optionally, check Customize the layout of the form?, then click Edit Template to change the default layout of the form.

  27. Click Next >.

  28. Optionally, change the default comment that describes the action.

  29. Click Finish.

See Also